﻿#include <iostream>
#include <vector>
using namespace std;
int main(){
    auto x = 1;        // 推导为 int
    auto y = 3.14;     // 推导为 double
    auto name = "Tom"; // 推导为 const char*
    // 替代STL容器迭代
    std::vector<int> vec = {1, 2, 3};
    for (auto it = vec.begin(); it != vec.end(); ++it) {
        std::cout << *it << std::endl;
    }
}